<?php
/**
 * Created by PhpStorm.
 * User: spring
 * Date: 2017/11/7
 * Time: 16:27
 * used to test redis
 */
namespace App\Http\Controllers;

use App\Http\Controllers\Common as helper;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;
use Laravel\Lumen\Routing\Controller as BaseController;

class RedisController extends BaseController{
    private $redis;
    function __construct()
    {
        $this->redis = helper::redis();
    }

    public function cache(){
//        $this->redis->set('spring','299792');
//        echo $this->redis->get('spring');
          Cache::put('lumen', 'Hello, Lumen333.', 5);
          return Cache::get('lumen');
    }

    public function redis(){
        Redis::set('kagome','inuyasha22');
        echo Redis::get('kagome');
    }
}